package com.ekuaitu.kuaitu.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.ekuaitu.kuaitu.R;
import com.ekuaitu.kuaitu.api.ApiStore;
import com.ekuaitu.kuaitu.api.UrlConstant;
import com.ekuaitu.kuaitu.base.BaseActivity;
import com.ekuaitu.kuaitu.bean.MyInvoiceDetailBean;
import com.ekuaitu.kuaitu.utils.MyApplication;
import com.ekuaitu.kuaitu.utils.SharedPreferencesUtils;
import com.ekuaitu.kuaitu.utils.StatusBarUtil;
import com.ekuaitu.kuaitu.utils.Toast.ToastCompat;
import com.zhy.autolayout.AutoLinearLayout;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.OnClick;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class MyInvoiceDetailActivity extends BaseActivity {

    @BindView(R.id.return_myInvoice_detail)
    ImageView returnMyInvoiceDetail;
    @BindView(R.id.toolbar_myInvoice_detail)
    AutoRelativeLayout toolbarMyInvoiceDetail;
    @BindView(R.id.invoice_detail_tv_status)
    TextView invoiceDetailTvStatus;
    @BindView(R.id.invoice_detail_tv_creatTime)
    TextView invoiceDetailTvCreatTime;
    @BindView(R.id.invoice_detail_tv_name)
    TextView invoiceDetailTvName;
    @BindView(R.id.invoice_detail_tv_phone)
    TextView invoiceDetailTvPhone;
    @BindView(R.id.invoice_detail_tv_address)
    TextView invoiceDetailTvAddress;
    @BindView(R.id.invoice_detail_tv_company)
    TextView invoiceDetailTvCompany;
    @BindView(R.id.invoice_detail_tv_content)
    TextView invoiceDetailTvContent;
    @BindView(R.id.invoice_detail_tv_money)
    TextView invoiceDetailTvMoney;
    @BindView(R.id.invoice_detail_tv_requestTime)
    TextView invoiceDetailTvRequestTime;
    @BindView(R.id.invoice_detail_tv_num)
    TextView invoiceDetailTvNum;
    @BindView(R.id.invoice_detail_tv_startToendTime)
    TextView invoiceDetailTvStartToendTime;
    @BindView(R.id.invoice_detail_tv_done)
    TextView invoiceDetailTvDone;
    @BindView(R.id.activity_my_invoice_detail)
    AutoLinearLayout activityMyInvoiceDetail;
    private Context mContext = this;

    @Override
    public int getLayoutId() {
        return R.layout.activity_my_invoice_detail;
    }

    @Override
    public void initView() {
        StatusBarUtil.setColor(this, getResources().getColor(R.color.colorPrimaryWhite), 0,true);
        Intent intent = getIntent();
        String invoiceId = intent.getStringExtra("invoiceId");
        getInvoiceDetail(invoiceId);
    }

    private void getInvoiceDetail(String invoiceId) {
        ApiStore.getInstance().getApiService(UrlConstant.Request.BASE_URL).getInvoiceDetail(MyApplication.getInstance().getRequestFieldMap(), invoiceId).enqueue(new Callback<MyInvoiceDetailBean>() {
            @Override
            public void onResponse(Call<MyInvoiceDetailBean> call, Response<MyInvoiceDetailBean> response) {
                if (response.isSuccessful() && response.body() != null) {
                }
            }

            @Override
            public void onFailure(Call<MyInvoiceDetailBean> call, Throwable t) {
                ToastCompat.makeText(mContext, getResources().getString(R.string.badNetwork), Toast.LENGTH_SHORT).show();
            }
        });
    }

    @OnClick({R.id.return_myInvoice_detail, R.id.invoice_detail_tv_done})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.return_myInvoice_detail:
                break;
            case R.id.invoice_detail_tv_done:
                break;
        }
    }
}
